package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    //查询菜品关联的套餐数量
    @Select("select count(setmeal_id) from setmeal_dish where dish_id=#{id}")
    int getCountBydishId(Long id);

    //批量新增
    void add(List<SetmealDish> setmealDishes);

    @Select("select * from setmeal_dish where setmeal_id=#{setmealId}")
    List<SetmealDish> getBySetmealId(Long setmealId);

    void dels(List<Long> ids);
}
